//
//  LoadingView.m
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/18.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "LoadingView.h"

@implementation LoadingView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    if (self) {
        [self initView];
    }
    return self;
}
- (void)initView{
    self.backgroundColor = WhiteColor;
    //  返回按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, h(20) + 5, 44, 44);
    [button setImage:[UIImage imageNamed:@"btn_fh"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(handButtonAction) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];
    
    
    UIImageView *stateImage = [[UIImageView alloc] init];
    stateImage.frame = CGRectMake(0, h(270), w(279), h(253));
    stateImage.image = Image(@"image_jiazaizhong");
    stateImage.centerX = self.centerX;
    
    [self addSubview:stateImage];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, getMaxY(stateImage), self.width, h(80))];
    label.centerX = self.centerX;
    label.numberOfLines = 0;
    label.text = @"客官等等~\n加载中....";
    label.font = font(32);
    label.textColor = ColorWithHexString(@"7ab3c4");
    label.textAlignment = NSTextAlignmentCenter;
    
    [self addSubview:label];

}


- (void)handButtonAction {
    [self.viewController.navigationController popViewControllerAnimated:YES];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
